home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume17 / pl / patch01 < prev    next >
Encoding:
Internet Message Format  |  1991-04-04  |  5.9 KB

  1. From: malc@equinox.unr.edu (Malcolm Carlock)
  2. Newsgroups: comp.sources.misc
  3. Subject: v17i081:  pl - Write to printer attached to user's Terminal or PC, Patch01
  4. Message-ID: <1991Apr4.042711.4454@sparky.IMD.Sterling.COM>
  5. Date: 4 Apr 91 04:27:11 GMT
  6. Approved: kent@sparky.imd.sterling.com
  7. X-Checksum-Snefru: e05170de 048a6c1e 392ae17c 06c5f937
  8.  
  9. Submitted-by: Malcolm Carlock <malc@equinox.unr.edu>
  10. Posting-number: Volume 17, Issue 81
  11. Archive-name: pl/patch01
  12. Patch-To: pl: Volume 17, Issue 72
  13.  
  14. The "tcput.c" program included with the recently posted PL program was
  15. written in ANSI C, and hence on most systems will fail to compile if "cc"
  16. is used to build it.  The program, as distributed on unr.edu (134.197.1.2),
  17. has been changed to fit the "standard" C model.  The actual code follows.
  18. Sorry;  this should have been distributed in "standard" C originally.
  19.  
  20. There have also been some problems reporting in getting kermit to print
  21. with PL when in heath-19 mode.  It works for me using Kermit version 2.32,
  22. but some other later versions appear to have a problem.  According to the
  23. latest on-line kermit docs nothing has changed in the printer control
  24. escape sequences since 2.32.  I'm wondering if there's a bug;  I'll be
  25. doing some more checking.
  26.  
  27. A way around the problem with heath-19 mode is to use Kermit's vt102
  28. emulation instead.  This appears to work with most (if not all) versions
  29. of Kermit.
  30.  
  31. Hope this helps.
  32.  
  33. Malcolm L. Carlock                      Internet:  malc@unr.edu
  34.                                         UUCP:      unr!malc
  35.                                         BITNET:    malc@equinox
  36. ----
  37. #! /bin/sh
  38. # This is a shell archive.  Remove anything before this line, then feed it
  39. # into a shell via "sh file" or similar.  To overwrite existing files,
  40. # type "sh file -c".
  41. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  42. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  43. # Contents:  PATCH01
  44. # Wrapped by kent@sparky on Wed Apr  3 22:23:42 1991
  45. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  46. echo If this archive is complete, you will see the following message:
  47. echo '          "shar: End of archive."'
  48. if test -f 'PATCH01' -a "${1}" != "-c" ; then 
  49.   echo shar: Will not clobber existing file \"'PATCH01'\"
  50. else
  51.   echo shar: Extracting \"'PATCH01'\" \(3049 characters\)
  52.   sed "s/^X//" >'PATCH01' <<'END_OF_FILE'
  53. X*** tcput.c.ansi    Wed Apr  3 22:11:57 1991
  54. X--- tcput.c    Wed Apr  3 22:10:34 1991
  55. X***************
  56. X*** 1,7 ****
  57. X  /*
  58. X   * tcput.c    Find the given terminal capability in the termcap database,
  59. X   *        interpet it, and print it to the terminal.  Raw mode is used
  60. X!  *        when printing to avoid system-level mappings.
  61. X   *
  62. X   *        Similar to tput on SYSV unix, but doesn't allow instantiation
  63. X   *        of parameter strings from the command line.
  64. X--- 1,8 ----
  65. X  /*
  66. X   * tcput.c    Find the given terminal capability in the termcap database,
  67. X   *        interpet it, and print it to the terminal.  Raw mode is used
  68. X!  *        when printing to avoid system-level mappings, unless such
  69. X!  *        a change isn't supported (i.e., a socket is in use.)
  70. X   *
  71. X   *        Similar to tput on SYSV unix, but doesn't allow instantiation
  72. X   *        of parameter strings from the command line.
  73. X***************
  74. X*** 12,21 ****
  75. X  #include    <stdio.h>
  76. X  #include    <sgtty.h>
  77. X  #include    <sys/ioctl.h>
  78. X  
  79. X  #define        PROG        "tcput"
  80. X  
  81. X! void        do_args(char **);
  82. X  void        usage();
  83. X  char        *getenv();
  84. X  
  85. X--- 13,25 ----
  86. X  #include    <stdio.h>
  87. X  #include    <sgtty.h>
  88. X  #include    <sys/ioctl.h>
  89. X+ #include    <errno.h>
  90. X  
  91. X+ extern        errno;
  92. X+ 
  93. X  #define        PROG        "tcput"
  94. X  
  95. X! void        do_args();
  96. X  void        usage();
  97. X  char        *getenv();
  98. X  
  99. X***************
  100. X*** 25,31 ****
  101. X  
  102. X  int        mputc();
  103. X  
  104. X! main(int argc, char **argv)
  105. X  {
  106. X      int    val;
  107. X      char    *cp = bp;
  108. X--- 29,37 ----
  109. X  
  110. X  int        mputc();
  111. X  
  112. X! main(argc, argv)
  113. X! int argc;
  114. X! char **argv;
  115. X  {
  116. X      int    val;
  117. X      char    *cp = bp;
  118. X***************
  119. X*** 50,56 ****
  120. X  }
  121. X  
  122. X  void
  123. X! do_args(char **argv)
  124. X  {
  125. X      for (++argv; *argv != NULL && **argv == '-'; ++argv) switch(*++*argv) {
  126. X      case 'T':
  127. X--- 56,63 ----
  128. X  }
  129. X  
  130. X  void
  131. X! do_args(argv)
  132. X! char **argv;
  133. X  {
  134. X      for (++argv; *argv != NULL && **argv == '-'; ++argv) switch(*++*argv) {
  135. X      case 'T':
  136. X***************
  137. X*** 76,82 ****
  138. X      exit(1);
  139. X  }
  140. X  
  141. X! mputc(int c)
  142. X  {
  143. X      putchar(c);
  144. X      return 0;
  145. X--- 83,89 ----
  146. X      exit(1);
  147. X  }
  148. X  
  149. X! mputc(c)
  150. X  {
  151. X      putchar(c);
  152. X      return 0;
  153. X***************
  154. X*** 86,97 ****
  155. X  {
  156. X      struct sgttyb    port;
  157. X  
  158. X!     if (ioctl(0, TIOCGETP, &port) < 0) {
  159. X          perror("raw: stdin");
  160. X          exit(1);
  161. X      }
  162. X      port.sg_flags |= RAW;
  163. X!     if (ioctl(0, TIOCSETP, &port) < 0) {
  164. X          perror("raw: stdin");
  165. X          exit(1);
  166. X      }
  167. X--- 93,104 ----
  168. X  {
  169. X      struct sgttyb    port;
  170. X  
  171. X!     if (ioctl(0, TIOCGETP, &port) < 0 && errno != EOPNOTSUPP) {
  172. X          perror("raw: stdin");
  173. X          exit(1);
  174. X      }
  175. X      port.sg_flags |= RAW;
  176. X!     if (ioctl(0, TIOCSETP, &port) < 0 && errno != EOPNOTSUPP) {
  177. X          perror("raw: stdin");
  178. X          exit(1);
  179. X      }
  180. X***************
  181. X*** 101,112 ****
  182. X  {
  183. X      struct sgttyb    port;
  184. X  
  185. X!     if (ioctl(0, TIOCGETP, &port) < 0) {
  186. X          perror("noraw: stdin");
  187. X          exit(1);
  188. X      }
  189. X      port.sg_flags &= ~RAW;
  190. X!     if (ioctl(0, TIOCSETP, &port) < 0) {
  191. X          perror("noraw: stdin");
  192. X          exit(1);
  193. X      }
  194. X--- 108,119 ----
  195. X  {
  196. X      struct sgttyb    port;
  197. X  
  198. X!     if (ioctl(0, TIOCGETP, &port) < 0 && errno != EOPNOTSUPP) {
  199. X          perror("noraw: stdin");
  200. X          exit(1);
  201. X      }
  202. X      port.sg_flags &= ~RAW;
  203. X!     if (ioctl(0, TIOCSETP, &port) < 0 && errno != EOPNOTSUPP) {
  204. X          perror("noraw: stdin");
  205. X          exit(1);
  206. X      }
  207. END_OF_FILE
  208.   if test 3049 -ne `wc -c <'PATCH01'`; then
  209.     echo shar: \"'PATCH01'\" unpacked with wrong size!
  210.   fi
  211.   # end of 'PATCH01'
  212. fi
  213. echo shar: End of archive.
  214. exit 0
  215. exit 0 # Just in case...
  216. -- 
  217. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  218. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  219. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  220. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  221.